<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <!--标题-->
    <title>APP临时事项申请</title>
    <!--设置meta标签,清除页面缓存-->
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <!--设定网页的到期时间。一旦网页过期，必须到服务器上重新调阅-->
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <!--网页在任何时候都不能被Cache存储-->
    <meta http-equiv="expires" content="-1">
    <!--在iPhone的浏览器中页面将以原始大小显示，并不允许缩放.width - viewport的宽度,height - viewport的高度,initial-scale - 初始的缩放比例,
        minimum-scale - 允许用户缩放到的最小比例,maximum-scale - 允许用户缩放到的最大比例,user-scalable - 用户是否可以手动缩放-->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
          name="viewport">
    <!--IE浏览器，IE8/9及以后的版本都会以最高版本IE来渲染页面-->
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!--这是编码格式，告诉给浏览器用什么方式来读这页代码-->
    <meta charset="utf-8">
    <!--定义站点的icon图标，跟网页中的图片有本质上的区别，icon是显示在地址栏最前面的一个16*16的小图标-->
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!--上传图片插件-->
    <link rel="stylesheet" href="/dist/plugins/webuploader-0.1.5/webuploader.css">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--图标-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!--插件样式-->
    <link href="/dist/plugins/ztree/css/zTreeStyle/zTreeStyle.css" rel="stylesheet"/>
    <!--OA主样式-->
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=f5a12a1d">
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=16f1e6f3">
    <link rel="stylesheet" href="/dist/css/oaApp.css">
    <!--页面定义样式-->
    <style type="text/css">
        .user {
            height: 30px;
            line-height: 30px;
            max-height: 30px;
            float: left;
            text-align: left;
            min-width: 32px;
            padding-left: 1px;
            overflow: hidden;
            cursor: pointer;
        }

        .user:hover {
            background-color: #cfd4d1;
        }

        .userbox .select.user {
            color: #fff;
            background-color: #045B9E;
        }

        .span-btn {
            position: absolute;
            left: 10px;
            margin-top: 4px;
            cursor: pointer;
        }

        .auditorName {
            text-align: center;
        }

        .IcoNormal {
            float: left;
            border-bottom: 0px;
            border-left: 0px;
            background-color: transparent;
            width: 16px;
            height: 16px;
            vertical-align: middle;
            border-top: 0px;
            border-right: 0px;
            background-image: url(/dist/img/upload_normal.gif);
            background-repeat: no-repeat;
            float: left;
        }

        .progressobj {
            height: 20px;
        }

        .progressobj .delfile {
            float: left;
            margin-left: 10px;
        }

        .select {
            color: #fff;
            background-color: #045B9E;
        }

        td .sp-value {
            display: inline-block;
            padding-left: 6px;
            word-wrap: break-word;
        }

        td {
            color: #2a8cec;
        }

        td.td-title, td select, td .filename, td.td-module {
            color: black;
            font-weight: normal !important;
        }

        .table-detail-payee:nth-child(even) td.td-title {
            background-color: white;
        }

        .printDiv {
            display: none;
        }

        .webuploader-pick {
            background: url(/dist/img/fjT1.png) no-repeat 5px center;
            display: block;
            padding: 0 4px;
            height: 22px;
            line-height: 22px;
            padding-left: 15px;
            margin: 0 auto;
            width: 70px;
            margin-top: 6px;
            border-radius: 4px;
        }

        .webuploader-pick-hover {
            color: #fff !important;
            background: url(/dist/img/fjT2.png) no-repeat 5px center;
            background-color: #0F6099;

        }

        #divUploadedFiles {
            /*padding: 4px;*/
            padding-bottom: 0;
        }

        .model-picker-dropdown {
            position: absolute;
            width: 315px;
            left: -9999px;
            top: -9999px;
            outline: 0;
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
            z-index: 999999;
            display: none;
            min-width: 200px;
            margin-bottom: 20px;
            margin-top: 5px;
        }

        .model-select-wrap {
            box-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
        }

        .model-select-tab {
            border-bottom: 1px solid #ccc;
            background: #f5f5f5;
            font-size: 13px;
        }

        .model-select-tab > a {
            display: inline-block;
            padding: 4px 20px;
            border-left: 1px solid #ccc;
            border-bottom: 1px solid transparent;
            color: #4D4D4D;
            text-align: center;
            outline: 0;
            text-decoration: none;
            cursor: pointer;
            font-size: 14px;
            margin-bottom: -1px;
        }

        .model-select-tab > a.active {
            background: #fff;
            border-bottom: 1px solid #fff;
            color: #46A4FF;
        }

        .model-select-tab > a:first-child {
            border-left: none;
        }

        .model-select-tab > a:last-child.active {
            border-right: 1px solid #ccc;
        }

        .model-select-content {
            width: 100%;
            min-height: 50px;
            background-color: #fff;
            padding: 5px 5px;
        }

        .model-select {
            font-size: 16px;
        }

        .model-select dl {
            line-height: 2;
            clear: both;
            padding: 3px 0;
            margin: 0;
            max-height: 200px;
            overflow-y: scroll;
        }

        .model-select dt {
            position: absolute;
            width: 2.5em;
            font-weight: 500;
            text-align: right;
            line-height: 2;
        }

        .model-select dd {
            margin-left: 0;
            line-height: 2;
        }

        .model-select.province dd {
            margin-left: 3em;
        }

        .model-select a {
            display: inline-block;
            padding: 0 10px;
            outline: 0;
            text-decoration: none;
            white-space: nowrap;
            margin-right: 2px;
            text-decoration: none;
            color: #333;
            cursor: pointer;
        }

        .model-select a:hover,
        .model-select a:focus {
            background-color: #f1f8ff;
            border-radius: 2px;
            color: #46A4FF;
        }

        .model-select a.active {
            background-color: #46A4FF;
            color: #fff;
            border-radius: 2px;
        }

        .biTian {
            position: absolute;
            color: #000;
            margin-left: -9px;
            margin-top: 2px;
        }

        [v-cloak] {
            display: none;
        }

        /*附件样式*/
        .fj-tanzhongStyle .down {
            float: left;
            width: auto;
            height: 100%;
            line-height: 29px;
            position: relative;
            left: 0;
            top: 0;
            margin-left: 10px;
        }

        .fj-tanzhongStyle .del {
            float: left;
            width: auto;
            height: 100%;
            line-height: 29px;
            position: relative;
            left: 0;
            top: 0;
            margin-left: 10px;
        }

        .tijiaoBtn {
            position: fixed;
            bottom: 0;
            left: 0;
            width: 50%;
            height: 50px;
            line-height: 50px;
            background: #2a8cec;
            color: #fff;
            text-align: center;
            font-weight: bold;
            font-size: 16px;
        }

        .fj-tanzhongStyle .name {
            float: left;
            text-overflow:  ellipsis;
            height: 100%;
            line-height: 29px;
            position: relative;
            left: 0;
            top: 0;
            width: 50%;
        }

        .fj-tanzhongStyle .down {
            float: left;
            width: auto;
            height: 100%;
            line-height: 29px;
            position: relative;
            left: 0;
            top: 0;
            margin-left: 10px;
        }

        .fj-tanzhongStyle .del {
            float: left;
            width: auto;
            height: 100%;
            line-height: 29px;
            position: relative;
            left: 0;
            top: 0;
            margin-left: 10px;
        }

        .scfj {
            background: url(/dist/img/fjT1.png) no-repeat 17px center;
            display: block;
            text-align: center !important;
            margin: 0 auto;
            width: 100%;
            border-radius: 4px;
            float: left;
            color: #74adf2;
            text-align: left;
        }

        select {
            outline: none;
        }


        .table-detail textarea {
            height: 68px;
            width: 100%;
            line-height: 1.2em;
            resize: none;
            border-width: 0px;
            border-style: none;
            padding-left: 6px;
            padding-right: 8px !important;
            padding-top: 8px !important;
            padding-bottom: 8px !important;
            margin-left: 0px;
            margin-right: 0px !important;
            margin-top: 0px !important;
            margin-bottom: 0 !important;
        }

        .touBtn {
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 50px;
            line-height: 50px;
            background: #2a8cec;
            color: #fff;
            text-align: center;
            font-weight: bold;
            font-size: 16px;
            margin: 0 auto;
            z-index: 11111;
        }

        .touBtn div {
            float: left;
            width: 50%;
            box-sizing: border-box;
            font-size: 16px;
        }

        .touBtn .line {
            height: 24px;
            width: 1px;
            background: #fff;
            position: absolute;
            left: 50%;
            top: 13px;
        }

        .vEdit {
            width: 100%;
            height: 100%;
            word-break: break-all;
            outline: none;
            user-select: text;
            white-space: pre-wrap;
            text-align: left;
            color:#2a8cec !important;
            font-size: 12px;
            line-height: 18px ;
            min-height: 240px;
        }
        .td-row3 .vEdit span{
            color:#2a8cec !important;
            font-size: 12px;
            float:left;
        }
        .vEdit[contenteditable=true] {
            user-modify: read-write-plaintext-only;
        }
        .vEdit:empty:before {
            content: attr(placeholder);
            display: block;
            color: #ccc;
        }
        .vEdit{
            height: 100%;
            padding: 5px 0;
            padding-left: 5px;
            padding-bottom: 8px;
        }
        #tdQuYJL .wyui-autocomplete-panel{
            right:0px !important;
            left:auto !important;
        }
        #tdQuYZC  .wyui-autocomplete-panel{
            right:0px !important;
            left:auto !important;
        }
    </style>
</head>
<body>
<div class="oaLoad">
    <div class="loadGif" id="areaProgress"></div>
</div>
<iframe id="ifAttach" style="display:none"></iframe>
<!--内容部分-->
<div class="layout" style="left:0px;top:0px;right:0px;bottom:0px;" id="app" v-cloak>
    <!--省市县-->
    <div class="model-picker-dropdown">
        <div class="model-select-wrap">
            <div class="model-select-tab">
                <a class="active" data-count="type">省</a><a class="" data-count="brand">市</a><a
                    data-count="model"
                    class="">县</a>
            </div>
            <div class="model-select-content">
                <div class="model-select type" data-count="type" style="display: block;">
                    <dl class="clearfix">
                        <a class="" :attr-id="item.id" v-for="item in itemsType">{{item.name}}</a>
                    </dl>
                </div>
                <div class="model-select brand" data-count="province">
                    <dl class="clearfix">
                        <a class="" :attr-id="item.id"
                           v-for="(item,i) in itemsBran">{{item.name}}</a>
                    </dl>
                </div>
                <div class="model-select model" data-count="model">
                    <dl class="clearfix">
                        <a class="" :attr-id="item.id"
                           v-for="(item,i) in itemsMod">{{item.name}}</a>
                    </dl>
                </div>
            </div>
        </div>
    </div>

    <div class="center" style="padding-bottom: 300px;">
        <!--表格-->
        <table class="table-detail">
            <tr class="no-print">
                <td colspan="4" class=" no-print td-module" style="background: #F5F5F5;">基本信息</td>
            </tr>
        </table>
        <table class="table-detail">
            <tr>
                <td style="width: 20%;" class="td-title">申请人</td>
                <td style="width: 30%;font-size:12px;text-align: left;padding-left: 6px !important;">
                    {{tmpEvent.main.createUserName}}
                </td>
                <td style="width: 20%;" class="td-title">申请时间</td>
                <td style="width: 30%;font-size:12px;text-align: left;padding-left: 6px !important;">
                    {{formatDate(tmpEvent.main.createTime)}}
                </td>
            </tr>
            <tr>
                <td class="td-title"><i class="biTian">*</i>事项类型</td>
                <td class="td-value">
                    <!--下拉选择类型 类型读取表中存储-->
                    <select style="background-color: transparent;margin-left:-7px;color: #2c8cec;"
                            v-model="tmpEvent.main.type"
                            @change="changeEventType">
                        <option v-for="option in typeList" :value="option.name">{{option.name}}
                        </option>
                    </select>
                </td>
                <td class="td-title">部门</td>
                <td style="text-align: left;padding-left: 6px !important;font-size: 12px;">
                    {{tmpEvent.main.orgName}}
                </td>

            </tr>
            <!--新机注册字段-->
            <template v-if="tmpEvent.main.type == '新机注册' ">
                <tr>
                    <td class="td-title"><i class="biTian">*</i>客户姓名</td>
                    <td class="td-value">
                        <input type="text" v-if="pageType=='edit'"
                               v-model="tmpEvent.main.customerName"/>
                        <span v-else>{{tmpEvent.main.customerName}}</span>
                    </td>
                    <td class="td-title"><i class="biTian">*</i>联系电话</td>
                    <td class="td-value">
                        <input type="tel" v-if="pageType=='edit'"
                               v-model="tmpEvent.main.customerTel"/>
                        <span v-else>{{tmpEvent.main.customerTel}}</span>
                    </td>
                </tr>
                <tr>
                    <td class="td-title"><i class="biTian">*</i>客户地址</td>
                    <td class="td-value" colspan="3">
                        <input type="text" class="selectModel" v-if="pageType=='edit'"
                               :value="showDz()">
                        <span v-else v-html="showDz()"></span>
                    </td>
                </tr>
                <tr>
                    <td class="td-title"><i class="biTian">*</i>机型</td>
                    <td class="td-value">
                        <input type="text" v-if="pageType=='edit'"
                               v-model="tmpEvent.main.modelName"/>
                        <span v-else>{{tmpEvent.main.modelName}}</span>
                    </td>
                    <td class="td-title"><i class="biTian">*</i>序列号</td>
                    <td class="td-value">
                        <input type="text" v-if="pageType=='edit'"
                               v-model="tmpEvent.main.sequence"/>
                        <span v-else>{{tmpEvent.main.sequence}}</span>
                    </td>
                </tr>
                <tr>
                    <td class="td-title"><i class="biTian">*</i>交机状态</td>
                    <td class="td-value">
                        <select id="deliveryState" v-if="pageType=='edit'"
                                @change="changeDeliveryState"
                                v-model="tmpEvent.main.deliveryState"
                                style=" background-color: transparent;margin-left:-5px;width:100%;color: #2a8cec;border-style:none;">
                            <option value='0'>未交机</option>
                            <option value='1'>已交机</option>
                        </select>
                        <span v-else>{{Flag2BuyType(tmpEvent.main.deliveryState)}}</span>
                    </td>
                    <td class="td-title"><i class="biTian"
                                            v-if="tmpEvent.main.deliveryState == '1'">*</i>交机日期
                    </td>
                    <td class="td-value" @click="showTimePicker">
                        <span v-if="pageType=='edit'" style="padding-left: 6px;">{{tmpEvent.main.deliveryDate}}</span>
                        <span v-else
                              style="padding-left: 6px;">{{tmpEvent.main.deliveryDate}}</span>
                    </td>

                </tr>
                <tr>
                    <td class="td-title"><i class="biTian"
                                            v-if="tmpEvent.main.deliveryState=='1'">*</i>购买方式
                    </td>
                    <td class="td-value">
                        <select id="buyType" v-if="pageType=='edit'" v-model="tmpEvent.main.buyType"
                                style=" background-color: transparent;width:100%;margin-left:-5px;color: #2a8cec;border-style:none;">
                            <option selected="selected">全款</option>
                            <option>内部分期</option>
                            <option>融资租赁</option>
                            <option>融资租赁打包</option>
                        </select>
                        <span v-else>{{tmpEvent.main.buyType}}</span>
                    </td>
                    <td class="td-title"></td>
                    <td class="td-value"></td>
                </tr>
            </template>

            <!--商务条件申请字段-->
            <template v-if="tmpEvent.main.type == '商务条件申请'">
                <tr>
                    <td class="td-title"><i class="biTian">*</i>客户姓名</td>
                    <td class="td-value">
                        <input type="text" v-if="pageType=='edit'"
                               v-model="tmpEvent.main.customerName"/>
                        <span v-else>{{tmpEvent.main.customerName}}</span>
                    </td>
                    <td class="td-title"><i class="biTian">*</i>机型</td>
                    <td class="td-value">
                        <input type="text" v-if="pageType=='edit'"
                               v-model="tmpEvent.main.modelName"/>
                        <span v-else>{{tmpEvent.main.modelName}}</span>
                    </td>
                </tr>
                <tr>
                    <td class="td-title"><i class="biTian">*</i>区域经理</td>
                    <td >
                        <input type="text" v-if="pageType=='edit'" class="regionManagerName"
                               v-model="tmpEvent.main.regionManagerName"/>
                        <span v-else>{{tmpEvent.main.regionManagerName}}</span>
                    </td>
                    <td class="td-title">大区经理</td>
                    <td id="tdQuYJL">
                        <input type="text" v-if="pageType=='edit'" class="bigRegionManagerName"
                               v-model="tmpEvent.main.bigRegionManagerName"/>
                        <span v-else>{{tmpEvent.main.bigRegionManagerName}}</span>
                    </td>
                </tr>
                <tr>
                    <td class="td-title">区域总监</td>
                    <td >
                        <input type="text" v-if="pageType=='edit'" class="regionDirectorName"
                               v-model="tmpEvent.main.regionDirectorName"/>
                        <span v-else>{{tmpEvent.main.regionDirectorName}}</span>
                    </td>
                    <td class="td-title">区域支持</td>
                    <td id="tdQuYZC">
                        <input type="text" v-if="pageType=='edit'" class="regionSupportName"
                               v-model="tmpEvent.main.regionSupportName"/>
                        <span v-else>{{tmpEvent.main.regionSupportName}}</span>
                    </td>
                </tr>
                <tr>
                    <td class="td-title">厂家支持</td>
                    <td colspan="3">
                        <input type="text" v-if="pageType=='edit'" class="manufactorSupportName"
                               v-model="tmpEvent.main.manufactorSupportName"/>
                        <span v-else>{{tmpEvent.main.manufactorSupportName}}</span>
                    </td>
                </tr>
            </template>

            <tr>
                <td class="td-title"><i class="biTian">*</i>详细描述</td>
                <td colspan="3"
                    style="text-align:left;">
                    <v-edit-div v-model='tmpEvent.main.description'  v-if="pageType=='edit'" placeholder="请输入"></v-edit-div>

                    <span v-else class="sp-value">{{tmpEvent.main.description}}</span>
                </td>
            </tr>
            <tr>
                <td class="td-title">附件</td>
                <td colspan="2" style="border-right: 0px;">
                    <div class="fj-tanzhongStyle" v-for="(attach,i) in tmpEvent.attaches"
                         v-if="attach.name!=''">
                        <b :class="fjStyle(attach.name)"></b>
                        <div class="name" :title="attach.name" :style="pageType=='look'?'':''"
                             :title="attach.name" v-on:click="download(attach.url,attach.name)">
                            {{attach.name}}
                        </div>
                        <div class="del"><span v-if="pageType=='edit'"
                                               class="nui-txt-link"
                                               style="color:#2a8cec;cursor: pointer;text-align: center;"
                                               v-on:click="deleteFile(i)">删除</span></div>
                    </div>
                </td>
                <td v-if="pageType=='edit'" style="border-left: 0px;">
                    <button type="button" class="btn oaBtn btn-sm" style="min-width: 40px;float: right;margin-right: 8px;"
                            @click="uploadFile">
                        上传
                    </button>
                </td>
            </tr>
        </table>
        <!--审核人-->
        <table class="table-detail no-print" style="border-top-width:0px;">
            <tr>
                <td class=" td-module" colspan="4" style="background: #F5F5F5;">审核人</td>
            </tr>
        </table>
        <table class="table-detail no-print" style="border-top-width:0px;">
            <tr v-for="(item,i) in tmpEvent.auditors">
                <td style="width: 20%;">
                    <span style="color: black;">审核人{{i+1}}</span>
                </td>
                <td style="border-right: 0px;text-align: left;" colspan="2">
                    <input v-if="pageType=='edit'" class="auditorName" type="text"
                           :value="item.auditorRoleName" :idx="i" style="text-align: left !important;"/>
                    <span v-else style="text-align: left !important;padding-left: 6px;">{{item.auditorName}}-{{item.roleName}}</span>
                </td>
                <td style="border-left: 0px;padding-right: 8px !important;text-align: right;width:120px;" >
                    <button type="button" class="btn oaBtn btn-sm" style="min-width: 40px;margin-top: -2px;"
                            @click="addItem('auditors','Audit')">
                        添加
                    </button>
                    <button type="button" class="btn oaBtn btn-sm" style="min-width: 40px;margin-top: -2px;"
                            @click="delItem('auditors',i,'审核人')">
                        删除
                    </button>
                </td>
            </tr>
        </table>
        <!--抄送人-->
        <table class="table-detail" style="border-top-width:0px;">
            <tr class="printDiv">
                <td class="td-title " style="background: #d3e8fd !important;">审核人</td>
                <td class="" colspan="3">
                    <div v-for="(item,i) in tmpEvent.auditors" class="user">{{item.auditorName}};
                    </div>
                </td>
            </tr>
            <tr>
                <td class="td-title" style="width: 20%;">抄送人</td>
                <td colspan="3">
                    <div id="user" style="padding-left:6px;"
                         v-on:click.stop="inputFocus('txtCopier')">
                        <div v-for="(user,i) in tmpEvent.copiers" class="user"
                             v-bind:class="{ select: copierSelectedIdx == i }"
                             v-on:click="selectUser(i,'copierSelectedIdx')">{{user.copyPersonName}};
                        </div>
                        <input v-if="pageType=='edit'" class="pull-left copier" id="txtCopier"
                               style="width:100px"
                               type="text" @keyup.delete="deleteUser"/>
                    </div>
                </td>
            </tr>
            <tr v-if="tmpEvent.main.copierReturnReason">
                <td class="td-title" >驳回原因</td>
                <td colspan="3" style="text-align:left;">
                    <span class="td-value" style="padding-left: 6px;">{{tmpEvent.main.copierReturnReason}}</span>
                </td>
            </tr>
        </table>
        <!--历史驳回记录-->
        <table class="table-detail" style="width: 100%;"
               v-if="tmpEvent.historys && tmpEvent.historys.length>0">
            <tr>
                <td class="td-title" colspan="4"
                    style="text-align: center;background-color: #d3e8fd;">历史驳回记录
                </td>
            </tr>
        </table>
        <table class="table-detail" style="width: 100%;"
               v-if="tmpEvent.historys && tmpEvent.historys.length>0">
            <template v-for="(item,i) in tmpEvent.historys">
                <tr>
                    <td class="td-title" style="width: 20%;"><i></i>审核人</td>
                    <td style="width:30%;text-align: left;background-color: white;">
                        <span style="padding-left: 4px;">{{item.auditorName}}</span>
                    </td>
                    <td class="td-title" style="width:20%;line-height: 20px;">审核日期</td>
                    <td style="width:30%;text-align: left;background-color: white;">
                        <span style="padding-left: 4px;">{{formatDate(item.auditTime)}}</span>
                    </td>
                </tr>
                <tr>
                    <td class="td-title"> 驳回原因</td>
                    <td class="td-value" colspan="3" style="text-align: left;background-color: white">
                        <div style="padding-left: 4px;line-height: 20px;">{{item.auditAdvise}}</div>
                    </td>
                </tr>
            </template>
        </table>
    </div>
    <!--提交保存按钮-->
    <div class="touBtn" v-if="tmpEvent.main.createUserId == getUrlParamObj().userId">
        <div @click="save(-1)"
             style="background-color: #228bee;margin-left:-1px;width: 50%;float:left;color:#fff;font-size: 14px;position: relative;font-weight: bold;">
            <strong>保存草稿</strong>
        </div>
        <div @click="save(0)"
             style="background-color: #228bee;width: 50%;float:left;color:#fff;font-size: 14px;font-weight: bold;">
            <strong>提交申请</strong>
        </div>
        <i class="line"></i>
    </div>
</div>
<!--开始引入js-->
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--bootstrap插件JS-->
<script src="https://file.ggxqce.com/web/bootstrap.min.js"></script>
<!--框架已定义 JS-->
<script src="/dist/js/app_iframe.js?t=7e54a132"></script>
<!--oa自定义 app和pc引入不同  JS-->
<script src="/dist/js/oaApp.js"></script>
<!--vue JS-->
<script src="https://file.ggxqce.com/web/vue.min.js"></script>
<!--自定义 JS-->
<script type="text/javascript" src="/dist/js/pages/apply/tmpevent/class.js"></script>
<script type="text/javascript" src="/dist/js/pages/system/systemService.js"></script>
<script type="text/javascript" src="/dist/js/pages/common/commonService.js"></script>
<script>
    $(function () {
        $("body").on("click", ".lineOne,.lineF", function (e) {
            if ($(".div-td-content-more").is(":hidden")) {
                var text = $(this).text();
                if (text != "") {
                    text = "<i></i>" + text;
                    $(".div-td-content-more").html(text).css({
                        "width": $(this).outerWidth() + "px",
                        "left": $(this).offset().left,
                        "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                    }).show();
                    e.stopPropagation();
                }
            } else {
                $(".div-td-content-more").hide();
            }
        });
        $("body").on("click", ".div-td-content-more", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".div-td-content-more").hide();
        });
    });
    $(function () {
        $("body").on("click", ".selectModel", function (e) {
            if ($(".model-picker-dropdown").is(":hidden")) {
                $(".model-picker-dropdown").css({
                    "width": $(this).outerWidth() + "px",
                    "left": $(this).offset().left,
                    "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                }).show();
                e.stopPropagation();
            } else {
                $(".model-picker-dropdown").hide();
            }
        });
        $("body").on("click", ".model-select-tab a", function (e) {
            $(this).parent().find("a").removeClass("active");
            $(this).addClass("active");
            var boxName = $(this).attr("data-count");
            $(".model-select").hide();
            $(".model-select-content" + " ." + boxName).show();
        });
        $("body").on("click", ".model-select  a", function (e) {
            if ($(this).hasClass("active")) {
                return false;
            }
            $(this).parent().find("a").removeClass("active");
            var id = $(this).attr("attr-id");
            $(this).addClass("active");
            var val = $(this).text();
            if ($(this).parents(".model-select").hasClass("type")) {
                $(".model-select-tab a").removeClass("active");
                $(".model-select-tab a[data-count=brand]").addClass("active");
                $(".model-select").hide();
                app.tmpEvent.main.provinceName = val;
                app.tmpEvent.main.cityName = '';
                app.tmpEvent.main.countyName = '';
                app.getCity(id);
                $(".model-select-content .brand").show();

            } else if ($(this).parents(".model-select").hasClass("brand")) {
                $(".model-select-tab a").removeClass("active");
                var id = $(this).attr("attr-id");
                $(".model-select-tab a[data-count=model]").addClass("active");
                $(".model-select").hide();
                app.tmpEvent.main.cityName = val;
                app.tmpEvent.main.countyName = '';
                app.getCounty(id);
                $(".model-select-content .model").show();

            } else {
                app.tmpEvent.main.countyName = val;
                $(".model-picker-dropdown").hide();
            }
        })
        $("body").on("click", ".model-picker-dropdown", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".model-picker-dropdown").hide();
        });
    });
    $.ajaxSetup({
        global: true,
        type: "POST",
        cache: false,
        dataType: "json",
        contentType: 'application/json;charset=utf-8',
        beforeSend: function () {
        },
        complete: function () {
//            JSBridge.call(UI, 'hideLoading', {});
        },
        error: function (e) {
            JSBridge.call(UI, 'showToast', {title: e.responseText});
        }
    });
    $.extend($.wyui, {
        postMethod: function (url, data, callback, sync, id) {
            if (!id) {
                id = "#app"
            }
            $.ajax({
                url: server.ip + url,
                async: sync ? false : true,
                data: JSON.stringify(data),
                beforeSend: function () {

                },
                complete: function () {
                    setTimeout(function () {
                    }, 1000);

                },
                success: function (r) {
                    if (!r.e.code) {
                        callback(r.data.sendData);
                    } else {
                        JSBridge.call(UI, 'showToast', {title: r.e.desc});
                    }
                },
                error: function (e) {
                    JSBridge.call(UI, 'showToast', {title: e.responseText});
                }
            });
        },
    });
</script>
<script type="text/javascript">
    Vue.component('v-edit-div', {
        props:{
            value: {
                type: String,
                default: ''
            }
        },
        data: function () {
            return {
                innerText: this.value,
                isLocked: false
            }
        },
        watch: {
            value: function () {
                console.log()
                if (!this.isLocked &&!this.innerText) {
                    this.innerText = this.value;
                }
            }
        },
        methods:{
            changeText: function (){
                this.$emit('input', (this.$el.innerHTML).replace(/<[^>]+>/g,""));
            }
        },
        template: '<div class="vEdit"  contenteditable="plaintext-only"   v-html="innerText"   @focus="isLocked = true" @blur="isLocked = false" @input="changeText"></div>'
    });
    var app = new Vue({
            el: "#app",
            data: {
                isGo:true,//是否可执行ajax
                companyName: '',//江苏瀛丰-IT部
                departName:'',
                provinceId: '省份',
                cityId: '市区',
                countyId: '县',
                itemsCom: [],
                itemsBran: [],
                itemsType: [],
                itemsMod: [],
                xinji: false,
                userId: getUrlParamObj().userId,
                pageType: 'edit',
                typeList: [],
                tmpEvent: {
                    main: {
                        id: '',
                        type: '',
                        title: '',
                        orgName: '',
                        regionName: '',
                        description: '',
                        createUserId: getUrlParamObj().userId,
                        auditFlag: '-1',
                        createUserName: '',
                        companyId: '',
                        createTime: new Date(),
                        currentAuditorId: '',
                        currentAuditorName: '',
                        modelId: '',
                        modelName: '',
                        sequence: '',
                        customerName: '',
                        customerTel: '',
                        customerAddress: '',
                        deliveryState: -1,
                        deliveryDate: '',
                        buyType: '',
                        provinceName: '',
                        cityName: '',
                        countyName: '',
                        regionManagerName:'',
                        regionManagerId : '',
                        regionManagerName : '',
                        bigRegionManagerId : '',
                        bigRegionManagerName : '',
                        regionDirectorId : '',
                        regionDirectorName : '',
                        regionSupportId : '',
                        regionSupportName : '',
                        manufactorSupportId : '',
                        manufactorSupportName : ''
                    },
                    auditors: [
                        new TmpEvent.Audit(),
                        new TmpEvent.Audit(),
                        new TmpEvent.Audit()
                    ],
                    historys: [],
                    copiers: [],
                    attaches: []//附件
                },
                auditorList: [],
                copierSelectedIdx: -1
            },
            methods: {
                getById: function() {
                    if (getUrlParamObj().platform == 'android') {
                    }
                    var that = this;
                    $.wyui.postMethod('/event/getById.json', {id: getUrlParamObj().id}, function (data) {
                        console.log(data);
                        setTimeout(function () {
                            initAutoComplete();
                        }, 300);
                        if (getUrlParamObj().platform == 'android') {
                        }
                        var params = {moduleId: data.main.id};
                        JSBridge.call(UI, 'hideLoading', {});
                        commonService.getAttachesByModuleId(params, function (attaches) {
                            if (attaches) {
                                data.attaches = attaches;
                            }
                            that.departName = data.main.orgName;
                            if (data.main.orgName.indexOf('-') > -1) {
                                data.main.orgName = data.main.orgName.split('-')[1]
                            }
                            that.tmpEvent = data;
                            var auditorRole = "";
                            for(var i=0;i < data.auditors.length;i++){
                                auditorRole = data.auditors[i].auditorName + "-" +data.auditors[i].roleName;
                                data.auditors[i].auditorRoleName = auditorRole;
                                console.log(data.auditors[i])
                            }
                        });
                    });
                },
                changeDeliveryState: function() {
                    if (this.tmpEvent.main.deliveryState == '0') {
                        this.tmpEvent.main.deliveryDate = ''
                        this.tmpEvent.main.buyType = ''
                    }
                },
                formatDate: function(now) {
                    return new Date(now).Format(TimeFormat.middle)
                    //return new Date(now).Format(TimeFormat.pcList);
                },
                /*处理交机状态在页面的显示*/
                Flag2BuyType: function(flage) {
                    if (flage == "0") return "未交机";
                    if (flage == "1") return "已交机";
                },
                /*选择省市县弹出框*/
                showDz: function() {
                    var html = '';
                    if (this.tmpEvent.main.provinceName) {
                        html += this.tmpEvent.main.provinceName;
                    }
                    if (this.tmpEvent.main.cityName != '') {
                        html += "-" + this.tmpEvent.main.cityName;
                    }
                    if (this.tmpEvent.main.countyName != '') {
                        html += "-" + this.tmpEvent.main.countyName;
                    }
                    return html;
                },
                inputFocus: function(id) {
                    $("#" + id).focus();
                },
                /*选择日期 APP*/
                showTimePicker: function() {
                    var that = this;
                    var param = {
                        title: '请选择',
                        startDate: '2019-01-01 00:00:00',
                        endDate: '2020-12-12 00:00:00',
                        showYear: true,
                        showMonth: true,
                        showDay: true,
                        showHour: false,
                        showMinute: false,
                        showSecond: false
                        //selectedDate: '2019-01-01 12:18:58'   //默认是当前时间
                    }
                    JSBridge.call(CALENDAR, 'showTimePicker', param, function (res) {
                        var date = new Date(res.sendData.data).Format("yyyy-MM-dd");
                        that.tmpEvent.main.deliveryDate = date;
                    })
                },
                /*获取市*/
                getCity: function (id) {
                    var that = this;
                    that.cityId = "市区";
                    that.countyId = "县";
                    that.itemsMod = "";
                    var data = {};
                    $.wyui.postMethod('/intentCustomer/getForProvinceById.json', {'id': id}, function (r) {
                        console.log(r);
                        that.itemsBran = r.records;
                    })
                },
                /*获取县*/
                getCounty: function(id) {
                    var that = this;
                    $.wyui.postMethod('/intentCustomer/getForProvinceById.json', {'id': id}, function (r) {
                        console.log(r);
                        that.itemsMod = r.records;
                    })
                },
                /*选择抄送人*/
                selectUser: function(i, prop) {
                    this.copierSelectedIdx = -1;
                    this[prop] = i;
                },
                unselectUser: function () {
                    this.copierSelectedIdx = -1;
                },
                /*删除抄送人*/
                deleteUser: function (event) {
                    if (event.keyCode == 46 || event.keyCode == 8 && event.target.value == "") {
                        if (this.copierSelectedIdx > -1) {
                            this.tmpEvent.copiers.splice(this.copierSelectedIdx, 1);
                            this.copierSelectedIdx = -1;
                        } else {
                            this.copierSelectedIdx = this.tmpEvent.copiers.length - 1;
                        }
                    }
                },
                /*删除附件*/
                deleteFile: function (i) {
                    //app使用
                    var that = this;
                    var param = {
                        title: "提示",
                        content: "确定要删除吗？",
                        cancelText: "取消",
                        confirmText: "确定",
                        showCancel: true,
                        cancelable: false
                    }
                    JSBridge.call(UI, 'showDialog', param, function (res) {
                        if (res.sendData.data == '确定') {
                            that.tmpEvent.attaches.splice(i, 1)
                        }
                    })
                },
                /*上传附件*/
                uploadFile: function () {
                    var that = this;
                    JSBridge.call(FILE, 'uploadFile', {}, function (res) {
                        var attacheObj = {
                            id: res.sendData.id,
                            name: res.sendData.name,
                            url: res.sendData.url
                        }
                        that.tmpEvent.attaches.push(attacheObj)
                    })
                },
                /*附件样式*/
                fjStyle: function (fjName) {
                    if (fjName) {
                        var type = fjName.substring(fjName.lastIndexOf('.') + 1);
                        return 'img fj-' + type
                    }
                    return 'img'
                },
                download: function (url) {
                    var that = this
                    var param = {
                        url: url,
                    }
                    JSBridge.call(FILE, 'showFile', param)
                    //downloadFile(attachId, fileName)
                    return false;
                },
                /*添加审核人*/
                addItem: function (prop, className) {
                    this.tmpEvent[prop].push(new TmpEvent[className]());
                    setTimeout(function () {
                        initAutoComplete();
                    }, 300);

                },
                /*删除审核人*/
                delItem: function (prop, i, desc) {
                    if (this.tmpEvent[prop].length <= 1) {
                        JSBridge.call(UI, 'showToast', {title: '请至少保留一位审核人'})
                        return
                    }
                    this.tmpEvent[prop].splice(i, 1);
                },
                /*保存方法*/
                save: function (auditFlag) {
                    var that = this;
                    console.log(that.tmpEvent)
                    if (!that.tmpEvent.main.type) {
                        JSBridge.call(UI, 'showToast', {title: '请选择事项类型'})
                        return;
                    }
                    if (auditFlag == "0") {
                        if (that.tmpEvent.main.type == '新机注册') {
                            if (!that.tmpEvent.main.customerName) {
                                JSBridge.call(UI, 'showToast', {title: '请填写客户姓名'})
                                return;
                            }
                            if (!that.tmpEvent.main.customerTel) {
                                JSBridge.call(UI, 'showToast', {title: '请填写客户电话'})
                                return;
                            }
                            if (!that.tmpEvent.main.provinceName) {
                                JSBridge.call(UI, 'showToast', {title: '请填写客户地址'})
                                return;
                            }
                            if (!that.tmpEvent.main.modelName) {
                                JSBridge.call(UI, 'showToast', {title: '请填写机型'})
                                return;
                            }
                            if (!that.tmpEvent.main.sequence) {
                                JSBridge.call(UI, 'showToast', {title: '请填写序列号'})
                                return;
                            }
                            if (!that.tmpEvent.main.deliveryState) {
                                JSBridge.call(UI, 'showToast', {title: '请选择交机状态'})
                                return;
                            }
                            if (that.tmpEvent.main.deliveryState == '1') {
                                if (!that.tmpEvent.main.deliveryDate) {
                                    JSBridge.call(UI, 'showToast', {title: '请选择交机日期'})
                                    return;
                                }
                                if (!that.tmpEvent.main.buyType) {
                                    JSBridge.call(UI, 'showToast', {title: '请选择购买方式'})
                                    return;
                                }
                            }
                        } else if (that.tmpEvent.main.type == '商务条件申请') {
                            if (!that.tmpEvent.main.customerName) {
                                JSBridge.call(UI, 'showToast', {title: '请填写客户姓名'})
                                return;
                            }
                            if (!that.tmpEvent.main.modelName) {
                                JSBridge.call(UI, 'showToast', {title: '请填写机型'})
                                return;
                            }
                            if (!that.tmpEvent.main.regionManagerName) {
                                JSBridge.call(UI, 'showToast', {title: '请填写区域经理姓名'})
                                return;
                            }
                        }
                        if (!that.tmpEvent.main.description) {
                            JSBridge.call(UI, 'showToast', {title: '请填写详细描述'})
                            return;
                        }
                    }
                    that.tmpEvent.main.auditFlag = auditFlag;

                    if (auditFlag == "-1") {
                        that.submitEvent(auditFlag)
                    } else {
                        that.showConfirmDialog(auditFlag)
                    }
                },
                showConfirmDialog: function (auditFlag) {
                    var that = this
                    var param = {
                        title: "提示",
                        content: "确定要提交吗？",
                        cancelText: "取消",
                        confirmText: "确定",
                        showCancel: true,
                        cancelable: false
                    }
                    JSBridge.call(UI, 'showDialog', param, function (res) {
                        if (res.sendData.data == '确定') {
                            that.submitEvent(auditFlag)
                        }
                    })
                },
                submitEvent: function (auditFlag) {
                    var that = this
                    JSBridge.call(UI, 'showLoading', {});
                    if(getUrlParamObj().id){
                        that.tmpEvent.main.orgName = that.departName;
                    }else {
                        that.tmpEvent.main.orgName = that.companyName;
                    }
                    that.tmpEvent.main.createTime = new Date().Format(TimeFormat.long);
                    that.tmpEvent.main.description = that.tmpEvent.main.description.replace(/\s+/g,"");
                    if(that.isGo){
                        that.isGo = false;
                        $.wyui.postMethod(urlConfig.apply.tmpevent.save, that.tmpEvent, function (data) {
                            JSBridge.call(UI, 'hideLoading', {});
                            if (auditFlag == "-1") {
                                JSBridge.call(UI, 'showToast', {title: "保存成功"})
                            } else {
                                JSBridge.call(UI, 'showToast', {title: "提交成功"})
                            }
                            that.isGo=true;
                            var param = {
                                backRefresh: true,       //是否返回刷新
                            }
                            JSBridge.call(ROUTER, 'navigateBack', param)
                        },false,true);
                    }

                },
                /*选择事项类型*/
                changeEventType: function () {
                    var that = this;
                    if (that.tmpEvent.main.type == '新机注册') {
                        that.xinji = true;
                        that.tmpEvent.auditors = [];
                        that.tmpEvent.copiers = [];
                        var newArr = [];
                        for (var i = 0; i < that.auditorList.length; i++) {
                            newArr.push(that.auditorList[i]);
                        }
                        console.log(newArr)
                        that.tmpEvent.auditors = newArr;
                        that.tmpEvent.main.deliveryDate = '';
                        that.tmpEvent.main.deliveryState = -1;
                        that.tmpEvent.main.buyType = '';
                        setTimeout(function () {
                            initAutoComplete();
                        }, 300);
                        console.log(that.tmpEvent.auditors)
                    } else if (that.tmpEvent.main.type == '商务条件申请') {
                        that.tmpEvent.auditors = [];
                        var newArr = [];
                        var newArrList = [];
                        for (var i = 0; i < that.SWTJ.auditors.length; i++) {
                            newArr.push(that.SWTJ.auditors[i]);
                        }
                        for (var j = 0; j < that.SWTJ.copiers.length; j++) {
                            newArrList.push(that.SWTJ.copiers[j]);
                        }
                        console.log(newArr)
                        that.tmpEvent.auditors = newArr;
                        that.tmpEvent.copiers = newArrList;
                        that.tmpEvent.main.deliveryDate = '';
                        that.tmpEvent.main.deliveryState = -1;
                        that.tmpEvent.main.buyType = '';
                        setTimeout(function () {
                            initAutoComplete();
                        }, 300);
                        console.log(that.tmpEvent.auditors)
                    } else {
                        that.tmpEvent.auditors = [];
                        that.tmpEvent.copiers = [];
                        var list = new Array();
                        $.wyui.postMethod(urlConfig.system.user.getFirstParent, {userId: getUrlParamObj().userId}, function (data) {
                            console.log(data)
                            list.push({
                                auditorId: data.id,
                                auditorName: data.name + "-" + data.roleName,
                                auditorRoleName: data.name + "-" + data.roleName
                            })
                            list.push({auditorId: "", auditorName: "", auditorRoleName: ""})
                            list.push({auditorId: "", auditorName: "", auditorRoleName: ""})
                            console.log(list)
                            that.tmpEvent.auditors = list;
                            that.tmpEvent.main.deliveryDate = '';
                            that.tmpEvent.main.deliveryState = -1;
                            that.tmpEvent.main.buyType = '';
                            setTimeout(function () {
                                initAutoComplete();
                            }, 300);
                        });
                    }
                },
                //获取临时事项类型
                getEventType: function () {
                    var that = this;
                    JSBridge.call(UI, 'showLoading', {});
                    $.wyui.postMethod("/aplType/getNameList.json", {modelName:'tmpevent'}, function (r) {
                        for (var i=0;i<r.names.length;i++) {
                            var o = {
                                "value": r.names[i].name,
                                "name": r.names[i].name
                            }
                            that.typeList.push(o)
                        }
                    });

                },
                //获取省份
                getUserProvince: function () {
                    var that = this
                    $.wyui.postMethod('/intentCustomer/getForProvinceById.json', {'id': '0'}, function (r) {
                        that.itemsType = r.records;
                    })
                },
                //获取第一审核人
                getFirstAuditor: function() {
                    var that = this
                    $.wyui.postMethod(urlConfig.system.user.getFirstParent, {userId: getUrlParamObj().userId}, function (data) {
                        app.tmpEvent.auditors[0].auditorId = data.id;
                        var auditName =  data.name;
                        if(auditName.length == 2){
                            auditName = auditName.substring(0,1)+"   "+ auditName.substring(1,2)
                        }
                        app.tmpEvent.auditors[0].auditorName = auditName + "-" + data.roleName;
                        app.tmpEvent.auditors[0].auditorRoleName = auditName + "-" + data.roleName;
                        JSBridge.call(UI, 'hideLoading', {});
                    });
                },

                //新机注册|商务条件
                getExtra: function () {
                    var that = this
                    /*根据userId获取用户信息*/
                    $.wyui.postMethod("/user/getUserViewById.json", {id: getUrlParamObj().userId}, function (r) {
                        that.tmpEvent.main.createUserName = r.name;
                        that.companyName = r.companyName + '-' + r.departName
                        that.tmpEvent.main.orgName = r.departName;
                        that.tmpEvent.main.companyId = r.companyId;

                        //获取新机注册的默认审核人
                        $.wyui.postMethod("/event/getAuditorsForXJZC.json",
                            {companyId: r.companyId, userId: getUrlParamObj().userId}, function (data) {
                                that.auditorList = data;
                            });

                        //获取商务条件申请默认审核人和抄送人
                        $.wyui.postMethod("/event/getAuditorsAndCopiers.json",
                            {companyId: r.companyId, userId: getUrlParamObj().userId}, function (data) {
                                that.SWTJ = data;
                            });
                    });

                }

            },
            mounted: function () {
                var that = this;
                that.getEventType()
                that.getUserProvince()
                that.getExtra()
                if (getUrlParamObj().id) {
                    that.getById()
                } else {
                    that.getFirstAuditor()
                }
                //启用长按复制
                JSBridge.call(UI,'setEnableLongClick',{enableLongClick:true})
            }
        })
    ;
</script>
<script>
    $(function () {
        initAutoComplete();
    });

    /*根据输入信息带出人员信息*/
    function initAutoComplete() {
        $(".auditorName,.copier,.regionManagerName,.bigRegionManagerName,.regionDirectorName,.regionSupportName,.manufactorSupportName").autoComplete({
            url: server.ip + urlConfig.system.user.getTop10ByNameUser,
            render: function (users, panel) {
                for (var i = 0; i < users.length; i++) {
                    $("<li></li>").data("autoComplete",
                        users[i]).html("<a>" + users[i].name + "&nbsp;&nbsp;&nbsp;" +
                        "(" + "&nbsp;" + users[i].companyName + "-" + users[i].departName + "-" + users[i].roleName + "&nbsp;" + ") " + "</a>")
                        .appendTo(panel);
                }
            },
            selected: function (user) {
                if ($(this).hasClass("auditorName")) {
                    var idx = $(this).attr("idx");
                    app.tmpEvent.auditors[idx].auditorId = user.id;
                    var auditName =  user.name
                    if(auditName.length == 2){
                        auditName = auditName.substring(0,1)+"   "+ auditName.substring(1,2)
                    }
                    app.tmpEvent.auditors[idx].auditorName = auditName + "-" + user.roleName;
                    app.tmpEvent.auditors[idx].auditorRoleName = auditName + "-" + user.roleName;
                } else if ($(this).hasClass("regionManagerName")) {
                    app.tmpEvent.main.regionManagerId = user.id;
                    app.tmpEvent.main.regionManagerName = user.name;
                    $.wyui.postMethod("/event/getUserInfoByUserId.json", {userId: app.tmpEvent.main.regionManagerId}, function (data) {
                        this.userInfo = data;
                        for(var i = 0;i < this.userInfo.length; i++){
                            if(this.userInfo[i].roleName == '大区经理'){
                                app.tmpEvent.main.bigRegionManagerId =  this.userInfo[i].userId;
                                app.tmpEvent.main.bigRegionManagerName =  this.userInfo[i].userName;
                            }
                            if(this.userInfo[i].roleName == '区域总监'){
                                app.tmpEvent.main.regionDirectorId =  this.userInfo[i].userId;
                                app.tmpEvent.main.regionDirectorName =  this.userInfo[i].userName;
                            }
                            if(this.userInfo[i].roleName == '区域支持'){
                                app.tmpEvent.main.regionSupportId =  this.userInfo[i].userId;
                                app.tmpEvent.main.regionSupportName =  this.userInfo[i].userName;
                            }
                            if(this.userInfo[i].roleName == '厂家支持'){
                                app.tmpEvent.main.manufactorSupportId =  this.userInfo[i].userId;
                                app.tmpEvent.main.manufactorSupportName =  this.userInfo[i].userName;
                            }
                        }
                    });
                }else if($(this).hasClass("bigRegionManagerName")){
                    app.tmpEvent.main.bigRegionManagerId =  user.id;
                    app.tmpEvent.main.bigRegionManagerName =  user.name;
                }
                else if($(this).hasClass("regionDirectorName")){
                    app.tmpEvent.main.regionDirectorId =  user.id;
                    app.tmpEvent.main.regionDirectorName =  user.name;
                }
                else if($(this).hasClass("regionSupportName")){
                    app.tmpEvent.main.regionSupportId =  user.id;
                    app.tmpEvent.main.regionSupportName =  user.name;
                }
                else if($(this).hasClass("manufactorSupportName")){
                    app.tmpEvent.main.manufactorSupportId =  user.id;
                    app.tmpEvent.main.manufactorSupportName =  user.name;
                }
                else if ($(this).hasClass("copier")) {
                    var userIds = new Array();
                    for (var i = 0; i < app.tmpEvent.auditors.length; i++) {
                        userIds.push(app.tmpEvent.auditors[i].auditorId);
                    }
                    for (var i = 0; i < app.tmpEvent.copiers.length; i++) {
                        userIds.push(app.tmpEvent.copiers[i].copyPersonId);
                    }
                    if ($.inArray(user.id, userIds) == -1) {
                        app.tmpEvent.copiers.push({
                            copyPersonId: user.id,
                            copyPersonName: user.name
                        });
                    } else {
                        JSBridge.call(UI, 'showToast', {title: '审核人、抄送人不能重复输入'});
                    }
                    $(this).val("");
                }
                return false;
            },
            height: 210,
            width: 300
        });
    }
</script>
</body>
</html>